
#ifndef _WEATHERFORM_H_
#define _WEATHERFORM_H_

#include <FBase.h>
#include <FUi.h>
#include <FMedia.h>
#include <FGraphics.h>
#include "../Utility/Downloader.h"
#include "../Ui/WeatherInfoForm.h"
#include "FormManager.h"
#include "WebForm.h"

class WeatherForm: public Osp::Ui::Controls::Form,
		public Osp::Ui::IActionEventListener,
		public Osp::Ui::IItemEventListener,
		public IDownloadFinishedListener {

	// Construction
public:
	WeatherForm(void);
	virtual ~WeatherForm(void);
	bool Initialize();
	result OnInitializing(void);
	result OnTerminating(void);

	// Implementation
protected:

	// Generated call-back functions
public:

	void OnActionPerformed(const Osp::Ui::Control&, int);
	void OnItemStateChanged(const Osp::Ui::Control &source, int index,
			int itemId, Osp::Ui::ItemStatus status);

	//MyCode
protected:
	//WeatherInfoForm *pWeatherInfoForm;
	Osp::Ui::Controls::EditField*pEditFieldDiaChi;
	Osp::Ui::Controls::Button*pButtonXem;
	Osp::Ui::Controls::Label*pThongBao;
//	Osp::Ui::Controls::Frame*pFrame;
//	Osp::Ui::Controls::Form *pFormParent;

	//Action Id

	const static int ID_SOFTKEY_BACK = 1036;
	const static int ID_SOFTKEY_XEMTHOITIET=1037;
	static int FormId;


public:
	void SetFormId(int id){
		this->FormId = id;
	}

	static int GetFormId(){
		return FormId;
	}

	void SetParentForm(Osp::Ui::Controls::Form*pParent);
	void SetFrame(Osp::Ui::Controls::Frame*pFrame);
	void HienThiThongTinThoiTiet();
	void OnDownloadComplete(Osp::Base::String url, Osp::Base::String path);
	void OnDownloadFailed(Osp::Base::String url, Osp::Base::String path);
	void OnDataDownloadComplete(int statusCode, Osp::Base::ByteBuffer *buffer){};
};

#endif
